import 'package:enterprise_v6_app/app/core/http/http.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/promise_day_record_detail_entity.dart';
import 'package:get/get.dart';

///每日承诺详情
class DailyCommitmentDetailController extends GetxController {
  /// 请求参数
  Map<String, dynamic> queryParameters = {};

  ///获取相应数据
  PromiseDayRecordDetailEntity? data = PromiseDayRecordDetailEntity();

  @override
  void onInit() {
    super.onInit();
    getPromiseDayRecordListGetDetail();
  }

  ///查询详情
  getPromiseDayRecordListGetDetail() async {
    queryParameters['id'] = Get.arguments;
    final res = await HttpUtil()
        .generateGetRequest<PromiseDayRecordDetailEntity>(
          Interface.promiseDayRecordListGetDetail,
          queryParameters: queryParameters,
        )
        .execute();
    res.onSuccess((result) {
      if (result.data != null) {
        data = result.data!;
      }
    });
    update();
  }
}
